package org.bpm.utils
{
	import flash.display.DisplayObject;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.utils.Timer;

	/**
	 * This util will animated fade in a displayobject from alpha 0 to 1,
	 * fade out can be added as the same way.
	 * */
	public class AnimatedDisplayUtil
	{
		public function AnimatedDisplayUtil()
		{
		}
		public static function animatedShow(pDO:DisplayObject):void{
			pDO.alpha = 0;
			pDO.addEventListener(Event.ENTER_FRAME, enterFrameShowHandler);
		}
		private static function enterFrameShowHandler(pEvent:Event):void{
			var dO:DisplayObject = pEvent.target as DisplayObject;
			dO.alpha += .1;
			if(dO.alpha>=1){
				dO.alpha = 1;
				dO.removeEventListener(Event.ENTER_FRAME, enterFrameShowHandler);
			}
		}
	}
}